import {AxiosRequestConfig} from "axios";
import {Pagination} from "~/icesoft/utils/service/types";

export interface JsonResult<T = any> {
    ok: boolean;
    code?: number;
    msg?: string;
    data?: T;
    page?: Pagination;
}

export interface HttpService {

    get<T>(url: string, config?: AxiosRequestConfig,token?:boolean): Promise<JsonResult<T>>,

    post<T>(url: string, data?: any, config?: AxiosRequestConfig,token?:boolean): Promise<JsonResult<T>>,

    put<T>(url: string, data?: any, config?: AxiosRequestConfig,token?:boolean): Promise<JsonResult<T>>,

    delete<T>(url: string, config?: AxiosRequestConfig,token?:boolean): Promise<JsonResult<T>>
}


